/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication1;
import java.io.*;
/**
 *
 * @author User
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        BufferedReader in=new BufferedReader(new FileReader("D:/in.txt"));
        String s, s2 = new String();
        while((s = in.readLine())!=null)
            s2+=s+"\n";
        in.close();
        int st=0;
        int end=s2.lastIndexOf('\n');
        char q[]=new char[end-st];
        s2.getChars(st, end, q, st);
        int i=st;
        int j=end-1;
	char buf;
        StringBuffer sb = new StringBuffer(s2);
	while(i<=j)
        {
                buf=q[i];
		q[i]=q[j];
		q[j]=buf;
		i++;
		j--;
	}
        PrintWriter out =new PrintWriter(new BufferedWriter(new FileWriter("D:/out.txt")));
        for(i=0;i<end;i++) out.print(q[i]);
        out.close();

        // TODO code application logic here
    }
}

